package com.linhh.mall.center.web.controller;

import com.linhh.mall.center.api.CollectionRecordService;
import com.linhh.mall.center.common.pojo.CollectionRecord;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author linhh
 * @Date 2023 03 18 11 57
 **/
@RestController
@RequestMapping("/api")
public class CollectionRecordController {

    @Reference
    private CollectionRecordService collectionRecordService;

    @RequestMapping("/collectionRecord/")
    public List<CollectionRecord> getCollectionRecordList(@RequestParam(required = false) String lendTime, @RequestParam(required = false)String endTime, @RequestParam(required = false)String target, @RequestParam(required = false)String inKeeper, @RequestParam(required = false)String outKeeper){
        List<CollectionRecord> collectionRecordList = collectionRecordService.getCollectionRecordList(lendTime,endTime,target,inKeeper,outKeeper);
        return collectionRecordList;
    }

}
